package com.rainng.coursesystem.controller.teacher;

import com.rainng.coursesystem.config.themis.annotation.Teacher;
import com.rainng.coursesystem.controller.BaseController;
import com.rainng.coursesystem.dao.mapper.ExamMapper;
import com.rainng.coursesystem.model.bo.CourseResourceDTO;
import com.rainng.coursesystem.model.bo.ExamDTO;
import com.rainng.coursesystem.model.vo.response.ResultVO;
import com.rainng.coursesystem.service.CourseResourceService;
import com.rainng.coursesystem.service.teacher.ExamService;
import com.rainng.coursesystem.service.teacher.VodService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Teacher
@RequestMapping("/teacher/exam")
@RestController("teacher_exam")
public class ExamController extends BaseController {


    @Autowired
    @Qualifier("teacher_service")
    private ExamService examService;

    @GetMapping
    public ResultVO listExam(){
        return examService.listExam();
    }

    @PostMapping
    public ResultVO addExam(@RequestBody ExamDTO dto){
        return examService.addExam(dto);
    }


    @PutMapping("{id}")
    public ResultVO updateExam(@PathVariable Integer id,@RequestBody ExamDTO dto){
        return examService.updateExam(id,dto);
    }

    @DeleteMapping("/{id}")
    public ResultVO deleteExam(@PathVariable Integer id){
        return examService.deleteExam(id);
    }

}
